import request from '@/utils/request'

// 查询客户订单明细列表
export function listScmCustomerOrderItems(query) {
  return request({
    url: '/scm/scmCustomerOrderItems/list',
    method: 'get',
    params: query
  })
}

export function listScmCustomerOrderItemsWithOrderInfo(query) {
  return request({
    url: '/scm/scmCustomerOrderItems/listCustomerOrderItemsWithOrderInfo',
    method: 'get',
    params: query
  })
}

 
// 查询客户订单明细详细
export function getScmCustomerOrderItems(itemId) {
  return request({
    url: '/scm/scmCustomerOrderItems/' + itemId,
    method: 'get'
  })
}

// 新增客户订单明细
export function addScmCustomerOrderItems(data) {
  return request({
    url: '/scm/scmCustomerOrderItems',
    method: 'post',
    data: data
  })
}

// 修改客户订单明细
export function updateScmCustomerOrderItems(data) {
  return request({
    url: '/scm/scmCustomerOrderItems',
    method: 'put',
    data: data
  })
}

// 删除客户订单明细
export function delScmCustomerOrderItems(itemId) {
  return request({
    url: '/scm/scmCustomerOrderItems/' + itemId,
    method: 'delete'
  })
}

// 拉取客户订单明细
export function pullScmCustomerOrderItems(data) {
  return request({
    url: '/scm/scmCustomerOrderItems/pull',
    method: 'put',
    data: data
  })
}

// 从询价单里选择
export function addScmCustomerOrderItemsFromQuotes(data, quotesIds) {
  return request({
    url: '/scm/scmCustomerOrderItems/addFromQuotes/' + quotesIds,
    method: 'put',
    data: data
  })
}

// 从历史订单item里直接添加
export function addScmCustomerOrderItemsFromOrdersOld(data, ids) {
  return request({
    url: '/scm/scmCustomerOrderItems/addFromOrderItems/' + ids,
    method: 'put',
    data: data
  })
}